//
//  SJZMacroDefine.h
//  SJZBusiness
//
//  Created by 彭利民 on 2018/4/26.
//  Copyright © 2018年 bwton. All rights reserved.
//

#ifndef SJZMacroDefine_h
#define SJZMacroDefine_h

/****通知宏定义**************************************************************************/
#define kLoginStatusChange    @"loginStatusChange"




/****基本宏定义**************************************************************************/

/** screenSize */
#define kScreenWidth        [UIScreen mainScreen].bounds.size.width
#define kScreenHeight       [UIScreen mainScreen].bounds.size.height
#define kScreen_Max_Length  (MAX(kScreenWidth, kScreenHeight))
#define kScreen_Min_Length  (MIN(kScreenWidth, kScreenHeight))

// 设计图基于5.5inch
#define kWIDTH_RATIO         (CGRectGetWidth([[UIScreen mainScreen] bounds]) / 414.0)
#define kHEIGHT_RATIO        (CGRectGetHeight([[UIScreen mainScreen] bounds]) / 736.0)


#define kAutoWidth(width)   kWIDTH_RATIO*width
#define kAutoHeight(height) kHEIGHT_RATIO*height
#define kAutoFont(font)     kWIDTH_RATIO*font

#define kHMargin            kAutoWidth(10)
#define kVMargin            kAutoHeight(10)

#define kImage(imageName)   [UIImage imageNamed:imageName]

#define kIS_IPHONE_4         (kScreen_Max_Length == 480.0)
#define kIS_IPHONE_5_OR_LESS (kScreen_Max_Length <= 568.0)
#define kIS_IPHONE_6_OR_MORE (kScreen_Max_Length >= 667.0)
#define kIS_IPHONE_5         (kScreen_Max_Length == 568.0)
#define kIS_IPHONE_6_OR_7    (kScreen_Max_Length == 667.0)
#define kIS_IPHONE_6P_OR_7R  (kScreen_Max_Length == 736.0)
#define kIS_IPHONE_X         (kScreen_Max_Length > 736.0)

/** 导航以及Tabbar高度 */
#define kNaviHeight         (kIS_IPHONE_X?88:64)
#define kTabbarHeight       (kIS_IPHONE_X?83:49)

//获取系统对象
#define kApplication        [UIApplication sharedApplication]
#define kAppWindow          [UIApplication sharedApplication].delegate.window
#define kAppDelegate        [AppDelegate shareAppDelegate]
#define kRootViewController [UIApplication sharedApplication].delegate.window.rootViewController
#define kUserDefaults       [NSUserDefaults standardUserDefaults]
#define kNotificationCenter [NSNotificationCenter defaultCenter]

//颜色
#define kRGBA(r,g,b,a)         [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]

//设置一个全局tableview的背景颜色
#define DSGlobleTableViewBackgroundColor kRGBA(248,248,250,1.0)

//weakself
#define kWeakSelf           __weak typeof (self) weakself = self

#endif /* SJZMacroDefine_h */
